/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.teach.dao;

import com.lczyfz.istep.common.persistence.CrudDao;
import com.lczyfz.istep.common.persistence.annotation.MyBatisDao;
import com.lczyfz.istep.modules.resource.entity.ResourcePaper;
import com.lczyfz.istep.modules.resource.entity.ResourcePaperQuestion;
import com.lczyfz.istep.modules.resource.entity.ResourceQuestion;
import com.lczyfz.istep.modules.teach.entity.TeachExam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 考试管理DAO接口
 * @author cqh
 * @version 2017-01-12
 */
@MyBatisDao
public interface TeachExamDao extends CrudDao<TeachExam> {

    //AlisaYe
    public List<ResourcePaper> findPaperList(String DEL_FLAG_NORMAL);

    //AlisaYe 2017/05/08
//    public List<TeachExam> findExamListById(TeachExam teachExam,@Param("id")String id,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);
    public List<TeachExam> findExamListById(@Param("id")String id,@Param("userId")String userId,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    public List<ResourcePaper> findPaperByExamId(@Param("id")String id,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);
    public List<ResourcePaperQuestion> findPaperQuestionByPaperId(@Param("id")String id,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);
    public List<ResourceQuestion> findQuesType0ByPaperId(@Param("paperId")String paperId,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);
    public List<TeachExam> findTeachExamByExamId(@Param("examId")String examId,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);


    //根据下发id和试卷id获取单条考试记录
    TeachExam getSingleRecord(@Param("distributeId")String distributeId, @Param("paperId")String paperId, @Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    //删除考试表数据-真删除
    void deleteExam(@Param("distributeId")String distributeId);

    //我的学习任务-获取考试名称
    List<TeachExam> stuLearnExam(@Param("distributeId")String distributeId, @Param("userId")String userId, @Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    //我的考试-列表查询
    List<TeachExam> findExamListById(TeachExam teachExam);

    //  根据考试科目id 查询参与此次考试科目的学生
    List<TeachExam> findExamStuById(@Param("id") String id, TeachExam teachExam);

    //根据学生id和试卷id判断该学生之前是否下发过某场考试
    List<TeachExam> getSingleRecordCheckExam(@Param("paperId")String paperId, @Param("userId")String userId, @Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);


}